package com.cater.examhelper.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.cater.examhelper.NurseExamHelperActivity;
import com.cater.examhelper.R;

public class RegisterInfoActivity extends Activity
{
	private Button button;

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.register_info);
		button = (Button) findViewById(R.id.top_back);
		button.setOnClickListener(new ReturnOnClickListener());
	}

	private class ReturnOnClickListener implements OnClickListener
	{
		@Override
		public void onClick(View v)
		{
			Intent intent = new Intent(RegisterInfoActivity.this, NurseExamHelperActivity.class);
			startActivity(intent);
			finish();
		}
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event)
	{
		if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0)
		{
			Intent intent = new Intent(RegisterInfoActivity.this, NurseExamHelperActivity.class);
			RegisterInfoActivity.this.startActivity(intent);
			RegisterInfoActivity.this.finish();
		}
		return super.onKeyDown(keyCode, event);
	}
}
